#include	<stdio.h>
#include	<stdlib.h>
#include 	<malloc.h>
#include	<string.h>

int main(int argc, char** argv)
{
	int **pp;
	int m = 10;
	int n =5;
	int i = 0;
	int j = 0;
	pp = (int**)malloc(sizeof(int*) * m);
	for(i = 0;i < m; i++)
	{
		*(pp + i) = (int*)malloc(sizeof(int)*n);
	}
//start =========================================
	
	for(i = 0; i < m; i++)
	{
		for(j = 0; j < n; j++)
		{
			*(*(pp + i) + j) = i;
		}
	}

	for(i = 0; i < m; i++)
	{
		for(j = 0; j < n; j++)
		{
			printf("%d  ",*(*(pp + i) + j));
		}
		printf("\n");
	}
	
//end ===========================================
	for(i = 0;i < m; i++)
	{
		free(*(pp + i));
	}
	free(pp);
	return 0;
}
